/**
 * 
 */
package yuanzw.movie.dao.impl;

import org.hibernate.Session;
import org.hibernate.Transaction;

import yuanzw.movie.dao.AdminDao;
import yuanzw.movie.domain.Admin;
import yuanzw.movie.utils.HibernateUtil;

/**
* @author yuanzhongwei
* @version 创建时间：2017年10月10日 上午11:08:02
*/
/**
 * @author yuanzhongwei
 *
 */
public class AdminDaoHibernateImpl implements AdminDao {

	/* (non-Javadoc)
	 * @see yuanzw.movie.dao.AdminDao#savaAdmin(yuanzw.movie.domain.Admin)
	 */
	public void savaAdmin(Admin admin) {
		// TODO Auto-generated method stub
		Session s = null;
		Transaction tx = null;
		try {
			s = HibernateUtil.getSession();
			tx = s.beginTransaction();
			s.save(admin);
			tx.commit();
		}finally {
			if(s != null) {
				s.close();
			}
		}
	}

	/* (non-Javadoc)
	 * @see yuanzw.movie.dao.AdminDao#findAdminByName(java.lang.String)
	 */
	public Admin findAdminByName(String name) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see yuanzw.movie.dao.AdminDao#findAdminById(int)
	 */
	public Admin findAdminById(int id) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see yuanzw.movie.dao.AdminDao#updateAdmin(yuanzw.movie.domain.Admin)
	 */
	public void updateAdmin(Admin admin) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see yuanzw.movie.dao.AdminDao#remove(yuanzw.movie.domain.Admin)
	 */
	public void remove(Admin admin) {
		// TODO Auto-generated method stub

	}

}
